package top.callname.bean;

import java.util.ArrayList;

public class ClassPageList extends RspInfoBean{

	 //当前页数
	private int pageNow=1;
	 //每页的条数
	private int offset=10;
	  //总记录
	private int totalSize=0;
	 //总页数
	private int totalPage=1;
	private int start=0; 
	private int navNo = 1; //导航开始页码
	
	private ArrayList<ClassBean> list;

	public int getPageNow() {
		return pageNow;
	}

	public int getOffset() {
		return offset;
	}

	public int getTotalSize() {
		return totalSize;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public int getStart() {
		return start;
	}

	public int getNavNo() {
		return navNo;
	}

	public ArrayList<ClassBean> getList() {
		return list;
	}

	public void setPageNow(int pageNow) {
		this.pageNow = pageNow;
		if(pageNow<=0) this.pageNow=1;
		if((pageNow-1)/5!=0){
			this.navNo = (pageNow-1)/5+1;
		}
	}

	public void setOffset(int offset) {
		this.offset = offset;
	}

	public void setTotalSize(int totalSize) {
		//根据总记录和当前页码计算start
		if(totalSize%this.offset==0){
			this.totalPage = totalSize/this.offset;
		}else{
			this.totalPage = totalSize/this.offset+1;
		}
		if(this.totalPage==0) this.totalPage=1;
		if(pageNow>totalPage) {
			this.start = (totalPage - 1) * offset;
		}else{
			this.start = (pageNow - 1) * offset;
		}
		this.totalSize = totalSize;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public void setNavNo(int navNo) {
		this.navNo = navNo;
	}

	public void setList(ArrayList<ClassBean> list) {
		this.list = list;
	}

	@Override
	public String toString() {
		return "ClassPageList [pageNow=" + pageNow + ", offset=" + offset + ", totalSize=" + totalSize + ", totalPage="
				+ totalPage + ", start=" + start + ", navNo=" + navNo + ", list=" + list + "]";
	}
	
	
	
}
